package com.wandian.message.mvvm.messagemanager;

import android.os.Bundle;

import androidx.databinding.DataBindingUtil;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mylib.libcore.config.RouterConfig;
import com.mylib.libcore.mvvm.BaseMVVMActivity;
import com.mylib.libcore.utils.StatusBarUtils;
import com.mylib.libcore.utils.ToastUtil;
import com.wandian.message.R;
import com.wandian.message.databinding.MessageActivityManagerBinding;

/**
 * @author Administrator
 * @date 2019/12/18-14:28
 * @description 消息管理
 **/
@Route(path = RouterConfig.ROUTER_ACTIVITY_MESSAGE_MANAGER)
public class MessageManagerActivity extends BaseMVVMActivity<MessageManagerViewModel>   {
    private MessageActivityManagerBinding dataBinding;

    @Override
    public void init(Bundle savedInstanceState) {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.message_activity_manager);
        dataBinding.setLifecycleOwner(this);
        dataBinding.setViewModel(mViewModel);
        initViewData();
        initClink();
    }



    private void initViewData(){
        StatusBarUtils.with(this,false)
                .setIsActionBar(false)
                .clearActionBarShadow()
                .setDrawable(getResources().getDrawable(R.drawable.sys_color_two))
                .init();
        dataBinding.bindSysToolBar.toolBarTvTitle.setText("消息");



        dataBinding.bindMessageStyleNextPage1.ivIcon.setBackgroundResource(R.drawable.img_msg_message_sx);
        dataBinding.bindMessageStyleNextPage1.tvLeft.setText("系统消息");

        dataBinding.bindMessageMy.ivIcon.setBackgroundResource(R.drawable.img_msg_message_pl);
        dataBinding.bindMessageMy.tvLeft.setText("我的消息");

        dataBinding.bindMessageChat.ivIcon.setBackgroundResource(R.drawable.img_msg_message_at);
        dataBinding.bindMessageChat.tvLeft.setText("及时通讯");
    }

    private void initClink(){
        dataBinding.bindSysToolBar.toolBarIvBack.setOnClickListener(v -> {
            finish();
        });

        //系统消息
        dataBinding.bindMessageStyleNextPage1.rlNextPage.setOnClickListener(v -> ARouter.getInstance().build(RouterConfig.ROUTER_ACTIVITY_SYS_MESSAGE).navigation());

        //我的消息
        dataBinding.bindMessageChat.rlNextPage.setOnClickListener(v -> ARouter.getInstance().build(RouterConfig.ROUTER_ACTIVITY_MY_MESSAGE).navigation());

        //及时通讯
        dataBinding.bindMessageChat.rlNextPage.setOnClickListener(v -> ToastUtil.show("待开放"));
    }



}
